// https://vitepress.dev/guide/custom-theme
import { h } from 'vue'
import type { Theme } from 'vitepress'
import DefaultTheme from 'vitepress/theme'
import './style.css'

// import ElementPlus from 'element-plus'
// import 'element-plus/dist/index.css'

import '@l-ui/theme-chalk/src/index.scss'
// import LIcon from '@l-ui/components/icon';
// import LMap from '@l-ui/components/map';

// import * as LComponents from '@l-ui/components'

import LPlus from 'l-ui';

export default {
  extends: DefaultTheme,
  Layout: () => {
    return h(DefaultTheme.Layout, null, {
      // https://vitepress.dev/guide/extending-default-theme#layout-slots
    })
  },
  enhanceApp({ app, router, siteData }) {
    // console.log(ElementPlus)
    // app.use(ElementPlus)
    // ...
    // app.use(LIcon) // 注册组件
    // app.use(LMap) // 注册组件
    // app.use(LEchart) // 注册组件
    app.use(LPlus); // 注册组件
    /* Object.entries(LComponents).forEach((item) => {
      const component = item[1];
      app.use(component);
    }); */
  }
} satisfies Theme
